<template>
  <uni-icons
      custom-prefix="van-icon"
      :type="'van-icon-' + name"
      :size="size"
      :color="color"
      @click="handleClick"></uni-icons>
</template>

<script setup>
// 定义props
const props = defineProps({
  name: {
    type: String,
    default: ''
  },
  size: {
    type: [String, Number],
    default: '14'
  },
  color: {
    type: String,
    default: ''
  },
});

// 定义emits
const emit = defineEmits(['click']);

// 定义方法
const handleClick = (e) => {
  emit('click', e);
};
</script>

<style lang="scss" scoped>
.uni-icons.van-icon {
  font-family: vant-icon;
  vertical-align: middle;
}
</style>